<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ include file="../common/tags.jsp" %>  
<%
	String path = request.getContextPath();
%>
<script type="text/javascript" src="<%=path%>/projectjs/regioninfo.js" ></script>
<script type="text/javascript">
var registerUserList=new RegionInfo("${pageContext.request.contextPath}","registerUserList_province_id","registerUserList_db_province_id","registerUserList_city_id","registerUserList_db_city_id","registerUserList_district_id","registerUserList_db_district_id","registerUserList");
function registerUser_sendCard(){
	var checkValue = "";
	var checkedObj=$('input[type="checkbox"][name="ids"]:checked');
	if(checkedObj.length>1){
		alertMsg.error("只能选择一个会员");
		return;
	}
	if(checkedObj.length==0){
		alertMsg.error("请选择一个会员");
		return;
	}
	var url = "<%=path %>/memberCard/sendCard.action?registerInfo="+encodeURIComponent(checkedObj.attr("sendCard"));
	var options = {mask:true,mixable:true,minable:true,resizable:true}; 
	$.pdialog.open(url, "sendCardDialog", "发卡",options);
}
</script>

<form id="pagerForm" method="post" action="<%=path %>/registerUser/listRegisterUser.action">
	<input type="hidden" name="pageRequest" value="1" />
	<input type="hidden" name="pageNum" value="${paginator.pageIndex}" />
	<input type="hidden" name="numPerPage" value="${paginator.pageSize}" />
</form>

<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" rel="pagerForm" action="<%=path %>/registerUser/listRegisterUser.action" method="post">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label style="text-align: right;">登录名：</label>
				<input type="text" name="registerUserVO.loginId" value='<s:property value="registerUserVO.loginId" />' size="20"/>
			</li>
			<li>
				<label style="text-align: right;">名字：</label>
				<input type="text" name="registerUserVO.userName" value='<s:property value="registerUserVO.userName" />' size="20"/>
			</li>
			<li>
				<label style="text-align: right;">联系电话：</label>
				<input type="text" name="registerUserVO.phone" value='<s:property value="registerUserVO.phone" />' size="20"/>
			</li>
		</ul>
		<ul class="searchContent">
			<li>
				<label style="text-align: right;">所属省份：</label>
				<input type="hidden" id="registerUserList_db_province_id" value="${registerUserVO.provinceRegionId}"/>
				<select name="registerUserVO.provinceRegionId" id="registerUserList_province_id" onchange="getAllCity('registerUserList')">
					<option value="">请选择</option>
             	</select>
			</li>
			<li>
				<label style="text-align: right;">所属市级：</label>
				<input type="hidden" id="registerUserList_db_city_id" value="${registerUserVO.cityRegionId}"/>
				<select name="registerUserVO.cityRegionId" id="registerUserList_city_id" onchange="getAllDistrict('registerUserList')">
					<option value="">请选择</option>
             	</select>
			</li>
			<li>
				<label style="text-align: right;">所属城区：</label>
				<input type="hidden" id="registerUserList_db_district_id" value="${registerUserVO.districtRegionId}"/>
				<select name="registerUserVO.districtRegionId" id="registerUserList_district_id">
					<option value="">请选择</option>
             	</select>
			</li>
		</ul>
		<ul class="searchContent">
			<li>
				<label style="text-align: right;">用户状态：</label>
				<select name="registerUserVO.status">
                       <option value="">选择状态</option>
                       <option value="0" ${registerUserVO.status == 0 ?"selected":"" }>有效</option>
                       <option value="1" ${registerUserVO.status == 1 ?"selected":"" }>暂停</option>
	            </select>
			</li>
				<li style="width:450px">
					<label style="text-align: right;">注册时间：</label>
					从： <input type="text" name="registerUserVO.gtregisterTime" value='<s:date name='registerUserVO.gtregisterTime' format="yyyy-MM-dd HH:mm:ss"/>'  dateFmt="yyyy-MM-dd HH:mm:ss" class="date" readonly="false"/>
					到： <input type="text" name="registerUserVO.ltregisterTime" value='<s:date name='registerUserVO.ltregisterTime' format="yyyy-MM-dd HH:mm:ss"/>'  dateFmt="yyyy-MM-dd HH:mm:ss" class="date" readonly="false"/>
				</li>
	    </ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="addRegisterUser">
			<li><a class="add" href="<%=path %>/registerUser/addRegisterUser.action" target="navTab"><span>添加</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="deleteRegisterUser">
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids" tbName="register_user" postType="string" href="<%=path %>/registerUser/deleteRegisterUser.action" class="delete"><span>删除</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="sendCard">
			<li><a rel="ids" href="javascript:registerUser_sendCard();" mask=true postType="string" warn="请选择一条记录" class="edit"><span>发卡</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="189">
		<thead>
			<tr>
				<th width="2%"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<th width="10%">登录名</th>
				<th>名字</th>
				<th>联系电话</th>
				<th>联系邮件</th>
				<th>用户状态</th>
				<th>注册日期</th>
				<th>省份</th>
				<th>市级</th>
				<th>城区</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="registerUserList" id="registerUser" status="st">
			 <tr target="sid_user" rel="<s:property value="id" />">
			 <td><input name="ids" value="<s:property value="id" />" sendCard="<s:property value="id" />,<s:property value="userName"/>,${phone}" type="checkbox"></td>
             <td><s:property value="loginId" /></td>	
             <td><s:property value="userName" /></td>	
             <td><s:property value="phone" /></td>	
             <td><s:property value="email" /></td>	
              <td>
             <s:if test="%{#registerUser.status == 0}">有效</s:if>
             <s:elseif test="%{#registerUser.status == 1}"></s:elseif>
             <s:else>暂停</s:else>
             </td>
			 <td><s:date name="registerTime" format="yyyy-MM-dd HH:mm:ss" /></td>
			 <td><s:property value="province.region" /></td>
			 <td><s:property value="city.region" /></td>
			 <td><s:property value="district.region"/></td>
					<td>
						<shiro:hasPermission name="deleteRegisterUser">
						<a title="确实要删除这条记录吗?" target="ajaxTodo" tbName="register_user" ids="${id}" href="<%=path %>/registerUser/deleteRegisterUser.action?ids=<s:property value="id" />" class="btnDel">删除</a>
						</shiro:hasPermission>
						<shiro:hasPermission name="editRegisterUser">
						<a title="编辑" target="navTab" href="<%=path %>/registerUser/editRegisterUser.action?registerUserVO.id=<s:property value="id" />" class="btnEdit">编辑</a>
						</shiro:hasPermission>
						<shiro:hasPermission name="viewRegisterUser">
						<a title="查看" target="navTab" href="<%=path %>/registerUser/viewRegisterUser.action?registerUserVO.id=<s:property value="id" />" class="btnView">查看</a>
						</shiro:hasPermission>
					</td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
				<span>显示</span>
				<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
					<option value="15" <c:if test="${paginator.pageSize==15}">selected='selected'</c:if> >15</option>
					<option value="30" <c:if test="${paginator.pageSize==30}">selected='selected'</c:if> >30</option>
					<option value="50" <c:if test="${paginator.pageSize==50}">selected='selected'</c:if> >50</option>
					<option value="100" <c:if test="${paginator.pageSize==100}">selected='selected'</c:if> >100</option>
					<option value="200" <c:if test="${paginator.pageSize==200}">selected='selected'</c:if> >200</option>
				</select>
				<span>条，共${paginator.totalCount}条</span>
			</div>
			<div class="pagination" targetType="navTab" totalCount="${paginator.totalCount}" 
				numPerPage="${paginator.pageSize}" pageNumShown="10" currentPage="${paginator.pageIndex}"></div>
	</div>
</div>